-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add regression test for WithDocumentationMode #17803
Conversation
reviews please: @dotnet/roslyn-compiler |
Assert.Equal(1, po2.Features.Count); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: extra empty line
When was the problem fixed? |
var po = new CSharpParseOptions().WithFeatures(new[] { new KeyValuePair<string, string>("IOperation", "true") }); | ||
Assert.Equal(1, po.Features.Count); | ||
var po2 = po.WithDocumentationMode(DocumentationMode.Diagnose); | ||
Assert.Equal(1, po2.Features.Count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make sure the values match while we're here and adding a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
f6905aa
to
4823ba2
Compare
4823ba2
to
29ff190
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor gripe
Assert.Equal(po2.Features.AsSingleton(), kvp); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Double blank line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor gripe
var kvp = new KeyValuePair<string, string>("IOperation", "true"); | ||
var po = new CSharpParseOptions().WithFeatures(new[] { kvp }); | ||
Assert.Equal(po.Features.AsSingleton(), kvp); | ||
var po2 = po.WithDocumentationMode(DocumentationMode.Diagnose); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var po2 = po.WithDocumentationMode(DocumentationMode.Diagnose); [](start = 12, length = 63)
I think it would be good to assert DocumentationMode before and after. What if the WithDocumentationMode method does nothing? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tested in the next test in the file.
LGTM |
closes #15358